package com.complaint.rest.service;

import com.complaint.rest.model.Complaint;
import com.complaint.rest.rc.RestClient;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Alex
 */
@Service
public class ComplaintServiceImpl implements ComplaintService {
    @Override
    public Complaint addComplaint(Complaint complaint) {
        return RestClient.get().addComplaint(complaint);
    }

    @Override
    public void removeComplaint(Complaint complaint) {
        RestClient.get().removeComplaint(complaint);
    }

    @Override
    public Complaint updateComplaint(Complaint complaint) {
        return RestClient.get().updateComplaint(complaint);
    }

    @Override
    public Complaint getComplaint(String id) {
        return RestClient.get().getComplaint(id);
    }

    @Override
    public List<Complaint> getComplaintsByUserId(String id) {
        return RestClient.get().getComplaintsByUserId(id);
    }

    @Override
    public List<Complaint> listComplaints() {
        return RestClient.get().listComplaints();
    }
}
